package keter.dao.org.impl;

import keter.dao.base.KeterAbstractDao;
import keter.dao.org.RoleDao;
import keter.domain.Role;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

@Repository
public class RoleDaoImpl extends KeterAbstractDao<Role> implements RoleDao {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(RoleDaoImpl.class);

    @Override
    public Role findByName(String name) {
        name = name.toUpperCase();
        return getSingleResult("from Role r where r.name = :name", 
                wrap("name"),
                wrap(name)
               );
    }

//	@Override
//	public List<Role> findByUserId(Long id) {
//		return getResultList("from Role r where r.account = :account", 
//				wrap("account"),
//				wrap(id));
//	}

}
